﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WikiNode : WikiPageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            return;
        string nidstring = Request["nid"];
        if (nidstring == null)
        {
            base.ShowError("missing parameter 'nid'");
            return;
        }
        int nodeid = -1;
        try
        {
            nodeid = Int32.Parse(nidstring);
        }
        catch (Exception exp)
        {
            base.ShowError("invalid nid string '" + nidstring + "'"+",Detail info:"+exp.ToString ());
            return;
        }
        try
        {
            this.NodePropertiesWebControl1.GraphDatabase = base.GraphDatabase;
            this.NodePropertiesWebControl1.NodeId = nodeid;
            if (this.NodePropertiesWebControl1.Node != null)
            {
                this.BannerControl1.SearchText = this.NodePropertiesWebControl1.Node.Label;
                this.Page.Title = "Natural Wiki - " + this.NodePropertiesWebControl1.Node.Label;
                this.HyperLinkout.NavigateUrl += "?NodeId=" + nodeid+"&Flag=1";
                this.HyperLinkin.NavigateUrl += "?NodeId=" + nodeid+"&Flag=0";
            }
        }
        catch (Exception exp)
        {
            base.ShowError(exp.ToString());
            return;
        }
    }

}
